<template>
    <div>
        <!-- 面包屑 -->
        <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>菜单管理</el-breadcrumb-item>
        </el-breadcrumb>
        <!-- 菜单管理表格 -->
        <template>
            <list @changeBtn="changeBtn"></list>
        </template>
        <!-- 弹框 -->
        <v-dialog :isDialog="isDialog" :isAdd="isAdd" @cancel="cancel"></v-dialog>
    </div>
</template>

<script>
import vDialog from "../components/menu/dialog.vue";
import list from "../components/menu/list.vue";

export default {
    data() {
        return {
            //控制dialog弹框
            isDialog: false,
            //控制是否是添加
            isAdd:true,
        };
    },
    methods: {
        //接收弹框发过来的事件 弹框消失
        cancel(e) {
            this.isDialog = e;
        },
        //接收列表发过来的 点击添加 或 编辑 按钮 显示对应内容
        changeBtn(e){
            this.isDialog = true
            this.isAdd = e
        }
    },
    components: {
        vDialog,
        list
    },

};
</script>

<style scoped>
.el-breadcrumb {
    margin-bottom: 30px;
}
</style>
